Bag detection using an electrostatic charge sensor

ABSTRACT

The present disclosure is directed to a device configured to detect whether the device is in a bag or being taken out of the bag. The device determines whether the device is in a bag or being taken out of the bag based on motion measurements generated by a motion sensor and electrostatic charge measurements generated by an electrostatic charge sensor. By using both distance measurements and motion measurements, the device is able to detect whether the device is in the bag or being taken out of the bag with high efficiency, accuracy, and robustness.

BACKGROUND Technical Field

The present disclosure is directed to a system and method for detectingwhether an electronic device is in a bag or is being taken out of a bag.

Description of the Related Art

Many electronic devices support a comprehensive and system-wide set ofpower management features to improve user experience, extend batteryduration, save energy, and reduce heat and noise of the device. Powermanagement features are particularly important for portable devices,such as laptop computers, tablets, and mobile devices, due to theirlimited power supply.

Power management features typically include options to transition thedevice between several different power states. For example, many devicessupport intermediate power states that are between an off state (e.g.,the device is completely shut down and consumes no power) and an onstate (e.g., the device is powered on and ready to be used by a user).Intermediate power states may include a sleep state in which the deviceis in a reduced power, idle state; and a hibernate state that is similarto the sleep state but consumes even less power. Intermediate powerstates allow a device to quickly return to an on state when the deviceis ready to be used by a user.

Many devices utilize device context recognition to customize transitionsbetween power states. A device context algorithm may detect severaldifferent activities, such as whether a device is stationary, being heldby a user that’s walking or running, or another type of activity. One ofthe simplest implementations of a device context recognition algorithmis based on motion sensors, such as accelerometers and gyroscopes.

Based on a detected activity, a device may transition between powerstates. For example, a laptop computer may switch from an on state to asleep state in response to detecting that the laptop computer is beingheld by a user that is walking or running, and switch from a hibernateor sleep state to an on state in response to detecting that the laptopcomputer is stationary.

BRIEF SUMMARY

The present disclosure is directed to a device that detects whether thedevice is in a bag (e.g., a briefcase, backpack, and shoulder bag) or isbeing taken out of the bag. The device determines whether the device isin a bag or is being taken out of the bag based on motion measurementsgenerated by a motion sensor and electrostatic charge measurementsgenerated by an electrostatic charge sensor. By using both motionmeasurements and electrostatic charge measurements, the device is ableto detect whether the device is in a bag or is being taken out of thebag with high efficiency, accuracy, and robustness.

A power state of the device is adjusted based on whether the device isin or outside of a bag. For example, the device may be set to an off orlow power state in response to detecting that the device is in a bag,and set to an on power state in response to detecting that the device isbeing taken out of the bag.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

In the drawings, identical reference numbers identify similar featuresor elements. The size and relative positions of features in the drawingsare not necessarily drawn to scale.

FIG. 1A is a first angled, perspective view of a device according to anembodiment disclosed herein.

FIG. 1B is a second angled, perspective view of the device of FIG. 1Aaccording to an embodiment disclosed herein.

FIG. 2 is a diagram of an electric charge sensor according to anembodiment disclosed herein.

FIG. 3 is a block diagram of a device according to an embodimentdisclosed herein.

FIG. 4A is an electrostatic charge measurement signal in a case where anelectrostatic charge sensor includes a single electrode and a device isinside a bag according to an embodiment disclosed herein.

FIG. 4B is an electrostatic charge measurement signal in a case where anelectrostatic charge sensor includes a single electrode and a device iscarried in a user’s hand according to an embodiment disclosed herein.

FIG. 5A is an electrostatic charge measurement signal in a case where anelectrostatic charge sensor includes two electrodes and a device isinside a bag according to an embodiment disclosed herein.

FIG. 5B is an electrostatic charge measurement signal in a case where anelectrostatic charge sensor includes two electrodes and a device iscarried in a user’s hand according to an embodiment disclosed herein.

FIG. 6 is a flow diagram of a method of detecting whether an orientationof a device has changed according to an embodiment disclosed herein.

FIG. 7A is an electrostatic charge measurement signal in a case where adevice is being taken out of a bag according to an embodiment disclosedherein.

FIG. 7B is an electrostatic charge measurement signal in a case where adevice is not taken out of a bag according to an embodiment disclosedherein.

FIG. 8 is a flow diagram of a method for a handheld detector and a falseout-from-bag detector according to an embodiment disclosed herein.

FIG. 9 is a block diagram of a device according to an embodimentdisclosed herein.

FIG. 10 is a block diagram of a device according to an embodimentdisclosed herein.

FIG. 11 is a block diagram of a device according to an embodimentdisclosed herein.

DETAILED DESCRIPTION

In the following description, certain specific details are set forth inorder to provide a thorough understanding of various aspects of thedisclosed subject matter. However, the disclosed subject matter may bepracticed without these specific details. In some instances, well-knownmachine learning techniques, power states, and structures and methods ofmanufacturing electronic devices and sensors have not been described indetail to avoid obscuring the descriptions of other aspects of thepresent disclosure.

Unless the context requires otherwise, throughout the specification andclaims that follow, the word “comprise” and variations thereof, such as“comprises” and “comprising,” are to be construed in an open, inclusivesense, that is, as “including, but not limited to.”

Reference throughout the specification to “one embodiment” or “anembodiment” means that a particular feature, structure, orcharacteristic described in connection with the embodiment is includedin at least one embodiment. Thus, the appearance of the phrases “in oneembodiment” or “in an embodiment” in various places throughout thespecification are not necessarily all referring to the same aspect.Furthermore, the particular features, structures, or characteristics maybe combined in any suitable manner in one or more aspects of the presentdisclosure.

As discussed above, many devices allow a manufacturer or user tocustomize transitions between power states of the device using devicecontext recognition. For example, a laptop computer may switch from anon state to a hibernate or sleep state in response to detecting that thelaptop computer is being held by a user that is walking or running, andswitch from a hibernate state to an on state in response to detectingthat the laptop computer is stationary.

It is desirable for device manufacturers to allow further customizationof power state transitions by detecting additional activities or eventsfor triggering the power state transitions. Activities that do notrequire direct interaction from the user are particularly desirablebecause the device does not have to rely on a user’s action (e.g.,pressing a power button, opening a laptop computer, closing a laptopcomputer, etc.). Rather, the device may preemptively trigger a powerstate transition for the user. As a result, user experience, batteryduration, energy conservation, and heat and noise of a device may beimproved further.

Some devices include in-bag detection, which detects whether the deviceis placed in a bag (e.g., a briefcase, backpack, and shoulder bag), andout-from-bag detection, which detects whether the device is being takenout of a bag. Typically, the device is set to a hibernate state inresponse to detecting that the device is inside of a bag to reduce orprevent overheating of the device; and is set to an on state in responseto detecting that the device is being taken out of a bag to allow theoperating system to wake up rapidly or preemptively. However, currentin-bag and out-from-bag detection methods entail large amounts ofprocessing and are time consuming. Further, current in-bag andout-from-bag detection methods often result in false detections.

The present disclosure is directed to a device with improved in-bag andout-from-bag detection. The bag may be a briefcase, backpack, shoulderbag, or any other type of container that holds the device. The deviceutilizes one or more motion sensors and an electrostatic charge sensorto detect whether the device is in a bag or is being taken out of thebag. Using the electrostatic charge sensor in combination with the oneor more motion sensors improves processing time for in-bag detection,and reduces false detections for out-from-bag detection. The devicesubsequently transitions between power states based on detecting whetherthe device is in or out of the bag.

FIG. 1A is a first angled, perspective view of a device 10 according toan embodiment disclosed herein. FIG. 1B is a second angled, perspectiveview of the device 10 according to an embodiment disclosed herein. Alength of the device 10 extends along an x axis, a width of the device10 extends along a y axis, and a height of the device 10 extends along az axis. It is beneficial to review FIGS. 1A and 1B together.

The device 10 is an electronic device that is configured to detectwhether the device 10 is in a bag or is being taken out of the bag. Inthe embodiment shown in FIGS. 1A and 1B, the device 10 is a laptopcomputer. However, the device 10 may be any type of electronic devicethat may be stored or carried in a bag. For example, the device 10 maybe a laptop computer, a tablet, a cellular phone, or any type of mobiledevice. The device 10 includes a motion sensor 12, an electrostaticcharge sensor 14, and a sensor controller 16.

The motion sensor 12 is configured to measure a motion of the device 10,and generates a motion measurement that indicates the measured motion.In one embodiment, the motion measurement is in the form of anelectrical signal (e.g., voltage or current signal) that is proportionalto the measured motion.

The motion sensor 12 may be an accelerometer that measures accelerationalong at least one axis. Alternatively, the accelerometer measuresacceleration along three axes (e.g., along the x, y, and z axes shown inFIGS. 1A and 1B).

The motion sensor 12 may also be a gyroscope that measures angularvelocity along at least one axis or that measures angular velocity alongthree axes (e.g., along the x, y, and z axes shown in FIGS. 1A and 1B).

In one embodiment, the motion sensor 12 is a combination sensor thatincludes both an accelerometer and a gyroscope, where the motion sensor12 measures both acceleration and angular velocity. Operation of themotion sensor 12 will be discussed in further detail below.

Although a single motion sensor 12 is shown in FIGS. 1A and 1B, thedevice 10 may include any number of motion sensors. For instance, thedevice 10 includes a first motion sensor that is an accelerometer, and asecond motion sensor that is a gyroscope.

The electrostatic charge sensor 14 is configured to generate anelectrostatic charge measurement that indicates the measuredelectrostatic charge. In one embodiment, the electrostatic chargemeasurement is in the form of an electrical signal (e.g., voltage orcurrent signal) that is proportional to the measured electrostaticcharge.

In one embodiment, the electrostatic charge sensor 14 includes a singleelectrode and electrical components (e.g., resistors, capacitors,amplifiers, etc.) that measure the electrostatic charge detected by thesingle electrode.

In one embodiment, the electrostatic charge sensor 14 includes twoelectrodes on two different surfaces of the device 10, and electricalcomponents (e.g., resistors, capacitors, amplifiers, etc.) that measurethe electrostatic charge detected between the two electrodes. FIG. 2 isa diagram of the electric charge sensor 14 according to an embodimentdisclosed herein. The electrostatic charge sensor 14 includes a pair ofinput terminals 18 a, 18 b, coupled to input electrodes E₁, E₂,respectively.

Each of the electrodes E₁, E₂ is made of conductive material and, in oneembodiment, coated with an insulating layer. The geometry of theelectrodes E₁, E₂ determines the sensitivity and directivity of theelectrostatic charge sensor 14. The sensitivity is proportional to thesurface area of the electrodes E₁, E₂. The shape of the electrodes E₁,E₂ and their positioning in space affects the directivity of theelectrostatic charge sensor 14. In one embodiment, the electrodes E₁, E₂are square in shape, with sides equal to about 2-10 cm (e.g., 5 cm).

The electrodes E₁, E₂ are positioned on one or more exposed surfaces ofthe device 10 such that the electrodes E₁, E₂ are exposed to asurrounding environment. For example, as shown in FIGS. 1A and 1B, theelectrode E₁ is positioned on an upper surface 24 of the device 10, andthe electrode E₂ is positioned on a lower surface 26 of the device 10.The electrodes E₁, E₂ may be positioned on any surface of the device 10,such as side surfaces of the device 10.

The pair of input terminals 18 a, 18 b receive, from the respectiveelectrodes E₁, E₂, an input voltage V_(d) (a differential signal), andsupplies the input voltage V_(d) to an instrumentation amplifier 20. Apresence of a bag generates a variation of electrostatic charge which,in turn, after having been detected by the electrodes E₁, E₂, generatesthe input voltage V_(d).

The instrumentation amplifier 20 includes operational amplifiers OP1,OP2 and a biasing stage (buffer) OP3. The biasing stage OP3 biases theinstrumentation amplifier 20 to a common mode voltage V_(CM).

An inverting terminal of the amplifier OP1 is electrically connected toan inverting terminal of the amplifier OP2 through a resistor R₂ acrosswhich there is a voltage equal to the input voltage V_(d). Therefore, acurrent equal to I₂=V_(d)/R₂ will flow through this resistor R₂. Thecurrent I₂ does not come from the input terminals of the operationalamplifiers OP1, OP2, and, therefore, runs through two resistors R₁connected between the outputs of the operational amplifiers OP1, OP2, inseries with the resistor R₂. The current I₂, which runs through theseries of the three resistors R₁-R₂-R₁, produces a differential outputvoltage V_(d)′, which is given by V_(d)′=(2R₁+R₂)I₂=(2R₁+R₂)V_(d)/R₂.The overall gain of the circuit of FIG. 2 isAd=V_(d)′/V_(d)=(2R₁+R₂)/R₂=1+2R₁/R₂. The differential gain depends onthe value of the resistor R₂ and may therefore be modified by acting onthe resistor R₂.

The differential output voltage V_(d)′, therefore being proportional tothe potential V_(d) between the input terminals 18 a, 18 b, is input toan analog-to-digital converter (ADC) 22, which outputs a chargevariation signal. The charge variation signal is, for example, ahigh-resolution digital stream (e.g., 16 bits or 24 bits). The chargevariation signal is an electrostatic charge measurement of anelectrostatic charge in a surrounding environment.

In another embodiment, the instrumentation amplifier 20 is omitted, sothat the ADC 22 receives the differential output voltage V_(d) betweenthe electrodes E₁, E₂ and samples the differential output voltage V_(d)directly. In another embodiment, the ADC 22 is omitted, and the chargevariation signal is the differential output voltage V_(d).

Although a single electrostatic charge sensor 14 is shown in FIGS. 1Aand 1B, the device 10 may include any number of electrostatic chargesensors. For example, the device 10 may include first and secondelectrostatic charge sensors with two electrodes of the firstelectrostatic charge sensor on two different surfaces of the device 10and two electrodes of the second electrostatic charge sensor on anothertwo different surfaces of the device 10.

Returning to FIGS. 1A and 1B, the sensor controller 16 iscommunicatively coupled to the motion sensor 12 and the electrostaticcharge sensor 14. The sensor controller 16 is configured to receivemotion measurements from the motion sensor 12 and electrostatic chargemeasurements from the electrostatic charge sensor 14, and determinewhether the device 10 is in a bag or is being taken out of the bag basedon the motion measurements and electrostatic charge measurements. Thesensor controller 16 is also configured to adjust a power state of thedevice 10. The sensor controller 16 may be a processor, controller,signal processor, or any other type of processing unit. Operation andthe location of the sensor controller 16 within the device 10 will bediscussed in further detail below.

FIG. 3 is a block diagram of the device 10 according to an embodimentdisclosed herein. As discussed above, the device 10 includes the motionsensor 12, the electrostatic charge sensor 14, and the sensor controller16. The motion sensor 12 generates motion measurements that indicatemeasured motions of the device 10, the electrostatic charge sensor 14generates an electrostatic charge measurement that indicates measuredelectrostatic charges from the electrodes of the device 10, and thesensor controller 16 determines whether the device 10 is in a bag orbeing taken out of the bag based on the motion measurements andelectrostatic charge measurements.

The sensor controller 16 includes an in-bag detector 28 and anout-from-bag detector 30. The in-bag detector 28 and the out-from-bagdetector 30 may be implemented as algorithms or software modulesexecuted by the sensor controller 16. Hardware solutions, such asdedicated circuitry configured to perform the functions of the in-bagdetector 28 and the out-from-bag detector 30, are also possible.

The in-bag detector 28 is communicatively coupled to the motion sensor12 and the electrostatic charge sensor 14. The in-bag detector 28receives motion measurements from the motion sensor 12 and electrostaticcharge measurements from the electrostatic charge sensor 14, and detectswhether or not the device 10 is inside a bag based on the motionmeasurements and the electrostatic charge measurements. As noted above,the bag may be a briefcase, backpack, shoulder bag, or any other type ofcontainer that holds the device 10. The in-bag detector 28 includes anactivity detector 32, a flat detector 34, a handheld detector 36, andin-bag detection logic 38.

The activity detector 32 detects an activity state of the device 10. Forexample, the activity detector 32 detects whether or not the device 10is in a steady state, a walking state, or a transport state. In thesteady state, the device 10 is stationary and is not moving. In thewalking state, the device 10 is being carried by a user that is walkingor running. In the transport state, the device 10 is in transit by, forexample, car, bike, train, bus, etc.

The activity detector 32 detects whether the device 10 is in the steadystate, the walking state, or the transport state based on the motionmeasurements received from the motion sensor 12. As discussed above, themotion measurements may include acceleration measurements of the device10, angular velocity measurements of the device 10, or a combination ofacceleration and angular velocity measurements of the device 10. Theactivity detector 32 outputs the detected state to the in-bag detectionlogic 38.

In one embodiment, the activity detector 32 classifies the motionmeasurements as the steady state, the walking state, or the transportstate using machine learning techniques, such as a decision tree, aneural network, and a support vector machine. For example, the activitydetector 32 computes a set of features to match current motionmeasurements to motion measurements expected for one of a plurality ofpre-defined classes of targeted activities of interest. Such an approachutilizes labeled training data for each of the activities desired to berecognized in order to generate the classifier. Moreover, deep neuralnetwork models may also be used and implemented for activityrecognition. Deep neural network models are capable of performingautomatic feature learning from the raw sensor data and out-performmodels fit on hand-crafted domain-specific features. Statistical models(e.g., Markov models and/or the like) can also be used.

The flat detector 34 detects whether the device 10 is in a flat state ora non-flat state. In the flat state, a base of the device 10 (e.g.,lower surface 26 of the device 10 as shown in FIG. 1B) is lying on aflat surface, such as a desk. In the non-flat state, the device 10 isnot level. That is, the base of the device 10 is not lying on a flatsurface.

The flat detector 34 detects whether the device 10 is in the flat stateor the non-flat state based on the motion measurements received from themotion sensor 12. As discussed above, the motion measurements mayinclude acceleration measurements of the device 10, angular velocitymeasurements of the device 10, or a combination of acceleration andangular velocity measurements of the device 10. The flat detector 34outputs the detected state to the in-bag detection logic 38.

In one embodiment, the flat detector 34 detects the flat state and thenon-flat state based on acceleration measurements along one or moreaxes. For example, referring to FIGS. 1 , the flat detector 34 detectsthe flat state in response to the motion sensor 12 measuring near zeroaccelerations (i.e., less than a first threshold value) along the x axisand the y axis, and measuring an acceleration parallel to a gravityvector (i.e., greater than a second threshold value) along the z axis.Conversely, the flat detector 34 detects the non-flat state in responseto the motion sensor 12 measuring non-zero accelerations (i.e., greaterthan the first threshold value) along the x axis or the y axis, ormeasuring a near zero acceleration transverse to a gravity vector (i.e.,less than the second threshold value) along the z axis.

The handheld detector 36 distinguishes between a scenario in which thedevice 10 is actually carried in a bag or is instead carried by a userwith a position or orientation that replicates the position of thedevice 10 in the bag, without actually being in the bag (e.g., device 10is carried under the user’s arm with the lid closed). In particular,there might be that case where the user has to move from one location toanother and carries the device 10 by hands for ease of transportation,without necessarily putting the device in the bag. In order to cope withthis further scenario, the handheld detector 36 senses whether thedevice 10 is actually in a bag or is carried hand-held (e.g., under theuser’s arm or kept/hold by a hand, or held at the user’s chest).

The handheld detector 36 detects whether the device 10 is in a handheldstate or a non-handheld state. In the handheld state, the device 10 isbeing carried in a user’s hand. In the non-handheld state, the device 10is not carried in a user’s hand and is instead being carried, forexample, in a bag. In one embodiment, the handheld detector 36 detectsthe non-handheld state in a case where the activity detector 32 detectsthe walking state. The handheld detector 36 outputs the detected stateto the in-bag detection logic 38.

The handheld detector 36 detects whether the device 10 is in thehandheld state or the non-handheld state based on the electrostaticcharge measurements from the electrostatic charge sensor 14. Asdiscussed above, the electrostatic charge measurements indicate measuredelectrostatic charges between the electrodes of the device 10.

When the device 10 is inside a bag, electrostatic charge measurementsare strongly amplified during motion compared to when the device 10 iscarried in a user’s hand. For example, FIG. 4A is an electrostaticcharge measurement signal 40 in a case where the electrostatic chargesensor 14 includes a single electrode and the device 10 is inside a bag,and FIG. 4B is an electrostatic charge measurement signal 42 in a casewhere the electrostatic charge sensor 14 includes a single electrode andthe device 10 is carried in a user’s hand.

In FIGS. 4A and 4B, the vertical axes are amplitudes of theelectrostatic charge measurement signals, and the horizontal axes aretime axes. The amplitudes are outputs from an analog-to-digitalconverter (ADC) with a full scale value (i.e., absolute maximum value)of 32,000, and the time axes are samples of the electrostatic chargemeasurements signals taken at 60 hertz for 5 seconds. Other amplitudeand time units are also possible.

Comparing the electrostatic charge measurement signal 40 to theelectrostatic charge measurement signal 42, it can be seen that theelectrostatic charge measurement signal 40 includes larger amplitudevalues and has greater variance. This is due to the large amounts ofelectrostatic charge being generated inside the bag when the device 10is in motion. For example, large amounts of electrostatic charge isgenerated from the bag being rubbed against inner surfaces of the bag.

As another example, FIG. 5A is an electrostatic charge measurementsignal 44 in a case where the electrostatic charge sensor 14 includestwo electrodes and the device 10 is inside a bag, and FIG. 5B is anelectrostatic charge measurement signal 46 in a case where theelectrostatic charge sensor 14 includes two electrodes and the device 10is carried in a user’s hand.

Similar to FIGS. 4A and 4B, in the examples shown in FIGS. 5A and 5B,the amplitudes are outputs from an ADC with a full scale value of32,000, and the time axes are samples of the electrostatic chargemeasurements signals taken at 60 hertz for 5 seconds.

Comparing the electrostatic charge measurement signal 44 to theelectrostatic charge measurement signal 46, it can be seen that theelectrostatic charge measurement signal 44 includes larger amplitudevalues and has greater variance.

Accordingly, the handheld detector 36 is able to determine whether thedevice 10 is in the handheld state or the non-handheld state bydetermining whether or not electrostatic charge measurements generatedby the electrostatic charge sensor 14 are strongly amplified.

In one embodiment, the handheld detector 36 determines whether or not anelectrostatic charge measurement signal generated by the electrostaticcharge sensor 14 is greater than or equal to a threshold value for athreshold number of times during a set period of time. In response tothe handheld detector 36 determining that the electrostatic chargemeasurement signal is greater than or equal to the threshold value forthe threshold number of times, the handheld detector 36 determines thatthe device 10 is in the non-handheld state. Conversely, in response tothe handheld detector 36 determining that the electrostatic chargemeasurement signal is not greater than or equal to the threshold value(i.e., less than the threshold value) for the threshold number of times,the handheld detector 36 determines that the device 10 is in thehandheld state.

In one embodiment, the handheld detector 36 determines whether or not avariance of an electrostatic charge measurement signal generated by theelectrostatic charge sensor 14 is greater than or equal to a thresholdvalue for a set period of time. In response to the handheld detector 36determining that the variance is greater than or equal to the thresholdvalue, the handheld detector 36 determines that the device 10 is in thenon-handheld state. In response to the handheld detector 36 determiningthat the variance is not greater than or equal to the threshold value(i.e., less than the threshold value), the handheld detector 36determines that the device 10 is in the handheld state.

Returning to FIG. 3 , the in-bag detection logic 38 receives thedetected states from the activity detector 32, the flat detector 34, andthe handheld detector 36; and determines whether or not the device 10 isin the in-bag state based on the detected states. In the in-bag state,the device 10 is estimated to be inside a bag.

In one embodiment, the in-bag detection logic 38 determines the device10 is in the in-bag state in a case where the device 10 is in the steadystate and the non-flat state, or is in the walking state and in thenon-handheld state, or is in the transport state. Stated differently,the in-bag detection logic 38 determines the device 10 is in the in-bagstate in a case where the following equation is met:

-   (Steady State = True AND Non-Flat State = True) OR-   (Walking State = True AND Non-Handheld State = True) OR-   (Transport State = True)

In case the device 10 includes two surfaces (e.g., a laptop with ascreen and a keyboard, or foldable device) the in-bag state is evaluatedwhen the device 10 is in a lid closed state in which the two surfacesare in contact with each other (e.g., the laptop or foldable device isshut closed). In this case, the in-bag detection logic 38 determines thedevice 10 is in the in-bag state in a case where the following equationis met:

-   (Lid Closed State = True) AND-   ((Steady State = True AND Non-Flat State = True) OR-   (Walking State = True AND Non-Handheld State = True) OR-   (Transport State = True))

As will be discussed in further detail below, the in-bag statedetermined by the in-bag detection logic 38 is output to, for example,an operating system layer of the device 10, and is used to adjust apower state of the device 10.

The out-from-bag detector 30 is communicatively coupled to the motionsensor 12 and the electrostatic charge sensor 14. The out-from-bagdetector 30 receives motion measurements from the motion sensor 12 andelectrostatic charge measurements from the electrostatic charge sensor14, and detects whether or not the device 10 is being taken out of a bagbased on the motion measurements and the electrostatic chargemeasurements. In contrast to the in-bag detector 28, which detects thein-bag state, the out-from-bag detector 30 detects an out-from-bag eventin which the device 10 is currently being taken out of a bag. As notedabove, the bag may be a briefcase, backpack, should bag, or any othertype of container that holds the device 10. The out-from-bag detector 30includes an orientation change detector 48 and a false out-from-bagdetector 50.

The orientation change detector 48 detects whether an orientation of thedevice 10 has changed. The orientation change detector 48 outputs anout-from-bag event to the false out-from-bag detector 50 in response todetecting an orientation change of the device 10. After detecting anout-from-bag event, the device 10 is estimated to be outside of a bag.

The orientation change detector 48 determines an orientation of thedevice 10 based on the motion measurements received from the motionsensor 12. In one embodiment, the motion sensor 12 is an accelerometer,and the orientation change detector 48 detects if the orientation of thedevice 10 has changed when an acceleration of the device 10 along atleast one axis is greater than a threshold value for a thresholdduration of time. FIG. 6 is a flow diagram of a method 52 of detectingwhether an orientation of the device 10 has changed according to anembodiment disclosed herein.

In block 54, the orientation change detector 48 determines whether ornot an acceleration of the device 10 along the axis parallel to gravityis greater than or equal to a first threshold value. In one embodiment,the first threshold value is between 800 and 900 mg. If the accelerationof the device 10 along the axis parallel to gravity is not greater thanor equal to the first threshold value (i.e., is less than the firstthreshold value), the method 52 moves to block 56. If the accelerationof the device 10 along the axis parallel to gravity is greater than orequal to the first threshold value, the method moves to block 58.

In block 56, a count value is set to zero. The count value is a totalnumber of consecutive times the acceleration of the device 10 along theaxis parallel to gravity is determined to be greater than or equal tothe first threshold value. The method 52 returns to block 54 for furtherprocessing.

In block 58, the count value is incremented by one. The method 52 thenmoves to block 60.

In block 60, the orientation change detector 48 determines whether ornot the count value is greater than or equal to a second thresholdvalue. In one embodiment, the second threshold value is between 25 and30. If the count value is not greater than or equal to the secondthreshold value (i.e., is less than the second threshold value), themethod returns to block 54 for further processing. If the count value isgreater than or equal to the second threshold value, the orientationchange detector 48 determines that an orientation of the device 10 haschanged, and outputs the out-from-bag event to the false out-from-bagdetector 50.

Returning to FIG. 3 , the false out-from-bag detector 50 is used todetermine whether or not the out-from-bag event detected by theorientation change detector 48 is a false detection. The falseout-from-bag detector 50 determines whether or not the out-from-bagevent detected by the orientation change detector 48 is a falsedetection by detecting the out-from-bag event again using electrostaticcharge measurements. If the false out-from-bag detector 50 detects theout-from-bag event again, the false out-from-bag detector 50 validatesthe out-from-bag event detected by the orientation change detector 48 asa true detection and outputs the out-from-bag event. If the falseout-from-bag detector 50 does not detect the out-from-bag event again,the false out-from-bag detector 50 invalidates the out-from-bag eventdetected by the orientation change detector 48 (i.e., determines theout-from-bag event detected by the orientation change detector 48 is afalse detection) and does not output the out-from-bag event.

The false out-from-bag detector 50 validates the out-from-bag eventdetected by the orientation change detector 48 based on theelectrostatic charge measurements from the electrostatic charge sensor14. In an actual out-from-bag event, there is a brief time period inwhich the device 10 is moving in the air. During this time period, theelectrostatic charge of the device 10 begins discharging. Conversely,during a false out-from-bag event, the electrostatic charge of thedevice 10 does not discharge. For example, FIG. 7A is an electrostaticcharge measurement signal 62 in a case where the device 10 is beingtaken out of a bag, and FIG. 7B is an electrostatic charge measurementsignal 64 in a case where the device 10 is not taken out of a bag (i.e.,the device 10 remains in a bag during the orientation change).

In FIGS. 7A and 7B, the vertical axes are amplitudes of theelectrostatic charge measurement signals, and the horizontal axes aretime axes. The amplitudes are outputs from an ADC with a full scalevalue (i.e., absolute maximum value) of 32,000, and the time axes aresamples of the electrostatic charge measurements signals taken at 60hertz for 2.5 seconds. Other amplitude and time units are also possible.

Referring to FIG. 7A, the encircled area is the time period in which thedevice 10 is taken out of the bag. As can be seen, the electrostaticcharge measurement signal 62 discharges (i.e., the amplitude theelectrostatic charge measurement signal 62 is near zero) in theencircled area. In contrast, in FIG. 7B, the electrostatic chargemeasurement signal 64 does not discharge as the device 10 is not takenout of the bag.

Accordingly, the false out-from-bag detector 50 is able to determinewhether or not the out-from-bag event detected by the orientation changedetector 48 is a false detection by determining whether or not theelectrostatic charge of the device 10 is discharged.

In one embodiment, the false out-from-bag detector 50 determines whetheror not an electrostatic charge measurement signal generated by theelectrostatic charge sensor 14 is less than or equal to a thresholdvalue for a set period of time. In response to the false out-from-bagdetector 50 determining the electrostatic charge measurement signal isless than or equal to the threshold value, the false out-from-bagdetector 50 validates the out-from-bag event detected by the orientationchange detector 48 as a true detection and outputs the out-from-bagevent. Conversely, in response to the false out-from-bag detector 50determining the electrostatic charge measurement signal is not less thanor equal to the threshold value (i.e., greater than the thresholdvalue), the false out-from-bag detector 50 invalidates the out-from-bagevent detected by the orientation change detector 48 (i.e., determinesthe out-from-bag event detected by the orientation change detector 48 isa false detection) and does not output the out-from-bag event.

The in-bag state determined by the in-bag detection logic 38 and theout-from-bag event validated by the false out-from-bag detector 50 areoutput to, for example, an operating system layer of the device 10. Theoperating system layer includes an operating system of the device 10that, for example, controls and coordinates the hardware components ofthe device 10 and any peripheral devices communicatively coupled to thedevice 10.

The operating system layer adjusts a power state of the device 10 basedon the in-bag state and the out-from-bag event. The power state of thedevice 10 may include any type of low, normal, or high power state nowknown or later developed. In one embodiment, the device 10 includes oneor more of the following power states: a working state, a lowpower/standby state, a sleep state, a hibernate state, a soft off state,and a mechanical off state. In the working state, the device 10 is fullypowered and ready to be used by a user. In the low power/standby state,the device 10 consumes less power than the working power state and isable to quickly switch to the working state. In the sleep state, thedevice 10 appears to be in an off state and consumes less power than thelow power/standby state. In the hibernate state, the device 10 appearsto be in an off state and consumes less power than the sleep state. Inthe soft off state, the device 10 appears to be in an off state andincludes a full shutdown and reboot cycle. In the mechanical off state,the device 10 is in an off state and consumes no power.

In one embodiment, in a case where the device 10 is in the in-bag stateand does not experience an out-from-bag event, the operating systemlayer sets the device 10 to a lower power state (e.g., the lowpower/standby state, the sleep state, the hibernate state, the soft offstate, etc.)..

In one embodiment, in a case where the device 10 experiences anout-from-bag event, the operating system layer switches the device 10 toa higher power state (e.g., from the hibernate state to the sleep state,from the sleep state to the working state, etc.).

In the embodiment discussed above, the operating system layer adjuststhe power state of the device 10. However, other components of thedevice 10 may also be used to adjust the power state. For example, inone embodiment, the sensor controller 16, itself, adjusts the powerstate of the device 10 based on the in-bag state and the out-from-bagevent.

In one embodiment, both the handheld detector 36 and the falseout-from-bag detector 50 utilize a machine learning approach to performdetection. Namely, the handheld detector 36 uses a machine learningapproach to classify electrostatic charge measurements as the handheldstate or the non-handheld state, and the false out-from-bag detector 50uses a machine learning approach to classify electrostatic chargemeasurements as the out-from-bag event or a non-out-from-bag event. FIG.8 is a flow diagram of a method 66 for the handheld detector 36 and thefalse out-from-bag detector 50 according to an embodiment disclosedherein.

In block 68, the electrostatic charge sensor 14 measures electrostaticcharges of the device 10, and generates an electrostatic chargemeasurement signal that indicates the measured electrostatic charges. Inone embodiment, the device 10 includes a buffer to store a plurality ofelectrostatic charge measurements, and generates an electrostatic chargemeasurement signal using the plurality of electrostatic chargemeasurements when the buffer is full.

In block 70, the sensor controller 16 receives the electrostatic chargemeasurement signal from the electrostatic charge sensor 14, and extractsfeatures from the electrostatic charge measurement signal.

The extracted features characterize the amplitude and the instability ofthe electrostatic charge measurement signal. For example, the sensorcontroller 16 determines at least one of the following calculations tocharacterize the electrostatic charge measurement signal: an energycalculation (e.g., a total energy of the electrostatic chargemeasurement signal in a period of time), a variance calculation (e.g., avariance of the electrostatic charge measurement signal in a period oftime), a zero crossing calculation (e.g., a number of times theelectrostatic charge measurement signal crosses zero in a period oftime), a peak-to-peak calculation (e.g., a difference between themaximum amplitude and the minimum amplitude of the electrostatic chargemeasurement signal in a period of time), a peak count calculation (e.g.,a total number of peaks in the electrostatic charge measurement signalin a period of time), an absolute mean calculation (e.g., an absolutemean of the electrostatic charge measurement signal in a period oftime), a maximum calculation (e.g., a maximum of the electrostaticcharge measurement signal in a period of time), or a minimum calculation(e.g., a minimum of the electrostatic charge measurement signal in aperiod of time). Other types of calculations are also possible.

In one embodiment, the features are extracted within a time window ofthe electrostatic charge measurement signal. For example, the featuresmay be calculated within a 2.5 second time window. The time window is,for example, defined based on a minimum number of electrostaticmeasurements to ensure proper detection by the handheld detector 36 andthe false out-from-bag detector 50.

In block 72, the handheld detector 36 classifies the electrostaticcharge measurement signal as either the handheld state or thenon-handheld state based on the features extracted in block 70.

The handheld detector 36 uses a machine learning approach to classifythe electrostatic charge measurement signal as either the handheld stateor the non-handheld state. For example, the handheld detector 36 usesone of a decision tree, a neural network, or a support vector machine toclassify the electrostatic charge measurement signal. Other machinelearning techniques are also possible.

In one embodiment, the decision tree in the following table is used todetermine the handheld state and the non-handheld state.

Condition State Energy ≤ First Energy Threshold Value AND VarianceCalculation ≤ Variance Threshold Value Handheld Energy ≤ First EnergyThreshold Value AND Variance > Variance Threshold Value AND Peak Count >First Peak Count Threshold Value Non-Handheld Energy ≤ First EnergyThreshold Value AND Variance > Variance Threshold Value AND Peak Count ≤First Peak Count Threshold Value AND Zero Crossing > Zero CrossingThreshold Value Handheld Energy ≤ First Energy Threshold Value ANDVariance > Variance Threshold Value AND Peak Count ≤ First Peak CountThreshold Value AND Zero Crossing ≤ Zero Crossing Threshold Value ANDPeak Count > Second Peak Count Threshold Value Non-Handheld Energy ≤First Energy Threshold Value AND Variance > Variance Threshold Value ANDPeak Count ≤ First Peak Count Threshold Value AND Zero Crossing ≤ ZeroCrossing Threshold Value AND Peak Count ≤ Second Peak Count ThresholdValue Handheld Energy > First Energy Threshold Value AND Energy > SecondEnergy Threshold Value Non-Handheld Energy > First Energy ThresholdValue AND Energy ≤ Second Energy Threshold Value AND Peak-To-Peak >Peak-To-Peak Threshold Value Handheld Energy > First Energy ThresholdValue AND Energy ≤ Second Energy Threshold Value AND Peak-To-Peak ≤Peak-To-Peak Threshold Value Non-Handheld

In the decision tree above, the first peak count threshold value isgreater than the second peak count threshold value, and the first energythreshold value is less than the second energy threshold value.

Utilizing electrostatic charge sensor measurements to perform handhelddetection, greatly improves the efficiency and processing time of thehandheld detector 36, and, thus, the in-bag detector 28. For example,current handheld detection methods, which generally utilize motionmeasurements, calculate more than three times the features calculated bythe handheld detector 36, and execute decision trees that are more thantwice the size as the decision tree executed by the handheld detector36. As a result, current consumption and memory of the in-bag detector28 is reduced compared to current in-bag detection methods.

In block 74, the handheld detector 36 uses a meta-classifier to filterclassifications of the electrostatic charge measurement signal in block72. The handheld detector 36 filters classifications of theelectrostatic charge measurement signal to remove or reduce falsepositives.

In one embodiment, the handheld detector 36 reduces false detections ofthe handheld state by maintaining a first count value. The first countvalue is a total number of times the handheld detector 36 classified theelectrostatic charge measurement signal as the handheld state. When thetotal number is equal to or greater than a first threshold count value,the handheld detector 36 determines that the electrostatic chargemeasurement signal is the handheld state.

Similarly, in one embodiment, the handheld detector 36 reduces falsedetections of the non-handheld state by maintaining a second countvalue. The second count value is a total number of times the handhelddetector 36 classified the electrostatic charge measurement signal asthe non-handheld state. When the total number is equal to or greaterthan a second threshold count value, the handheld detector 36 determinesthat the electrostatic charge measurement signal is the non-handheldstate.

It is noted that block 74 may be removed (i.e., not performed) from themethod 66 to reduce latency of the handheld detector classificationblock 72.

Subsequent to block 74, the handheld detector 36 outputs the detectionresults to the in-bag detection logic 38 for further processing asexplained above with respect to FIG. 3 .

In block 76, the false out-from-bag detector 50 classifies theelectrostatic charge measurement signal as the out-from-bag event basedon the features extracted in block 70.

Similar to the handheld detector 36, the false out-from-bag detector 50uses a machine learning approach to classify the electrostatic chargemeasurement signal as the out-from-bag event. For example, the falseout-from-bag detector 50 uses one of a decision tree, a neural network,or a support vector machine to classify the electrostatic chargemeasurement signal. Other machine learning techniques are also possible.

In one embodiment, the decision tree in the following table is used todetermine the out-from-bag event or a non-out-from-bag event.

Condition Event Peak-To-Peak ≤ Peak-To-Peak Threshold Value AND PeakCount ≤ First Peak Count Threshold Value AND Zero Crossing ≤ First ZeroCrossing Threshold Value AND Variance Calculation ≤ Variance ThresholdValue AND Zero Crossing ≤ Second Zero Crossing Threshold ValueOut-From-Bag Peak-To-Peak ≤ Peak-To-Peak Threshold Value AND Peak Count≤ First Peak Count Threshold Value AND Zero Crossing ≤ First ZeroCrossing Threshold Value AND Variance Calculation ≤ Variance ThresholdValue AND Zero Crossing > Second Zero Crossing Threshold Value AND PeakCount ≤ Second Peak Count Threshold Value Out-From-Bag Peak-To-Peak ≤Peak-To-Peak Threshold Value AND Peak Count ≤ First Peak Count ThresholdValue AND Zero Crossing ≤ First Zero Crossing Threshold Value ANDVariance Calculation ≤ Variance Threshold Value AND Zero Crossing >Second Zero Crossing Threshold Value AND Peak Count > Second Peak CountThreshold Value Non-Out-From-Bag Condition Event Peak-To-Peak ≤Peak-To-Peak Threshold Value AND Peak Count ≤ First Peak Count ThresholdValue AND Zero Crossing ≤ First Zero Crossing Threshold Value ANDVariance Calculation > Variance Threshold Value Non-Out-From-BagPeak-To-Peak ≤ Peak-To-Peak Threshold Value AND Peak Count ≤ First PeakCount Threshold Value AND Zero Crossing > First Zero Crossing ThresholdValue AND Absolute Mean ≤ First Absolute Mean Threshold Value AND PeakCount ≤ Third Peak Count Threshold Value Non-Out-From-Bag Peak-To-Peak ≤Peak-To-Peak Threshold Value AND Peak Count ≤ First Peak Count ThresholdValue AND Zero Crossing > First Zero Crossing Threshold Value ANDAbsolute Mean ≤ First Absolute Mean Threshold Value AND Peak Count >Third Peak Count Threshold Value AND Energy ≤ Energy Threshold ValueNon-Out-From-Bag Peak-To-Peak ≤ Peak-To-Peak Threshold Value AND PeakCount ≤ First Peak Count Threshold Value AND Zero Crossing > First ZeroCrossing Threshold Value AND Absolute Mean ≤ First Absolute MeanThreshold Value AND Peak Count > Third Peak Count Threshold Value ANDEnergy > Energy Threshold Value AND Zero Crossing ≤ Third Zero CrossingThreshold Value AND Maximum ≤ First Maximum Threshold Value AND Maximum≤ Second Maximum Threshold Value AND Maximum ≤ Third Maximum ThresholdValue AND Peak Count ≤ Fourth Peak Count Threshold ValueNon-Out-From-Bag Peak-To-Peak ≤ Peak-To-Peak Threshold Value AND PeakCount ≤ First Peak Count Threshold Value AND Zero Crossing > First ZeroCrossing Threshold Value AND Absolute Mean ≤ First Absolute MeanThreshold Value AND Peak Count > Third Peak Count Threshold Value ANDEnergy > Energy Threshold Value AND Zero Crossing ≤ Second Zero CrossingThreshold Value AND Maximum ≤ First Maximum Threshold Value AND Maximum≤ Second Maximum Threshold Value AND Maximum ≤ Third Maximum ThresholdValue AND Peak Count > Fourth Peak Count Threshold Value Out-From-BagCondition Event Peak-To-Peak ≤ Peak-To-Peak Threshold Value AND PeakCount ≤ First Peak Count Threshold Value AND Zero Crossing > First ZeroCrossing Threshold Value AND Absolute Mean ≤ First Absolute MeanThreshold Value AND Peak Count > Third Peak Count Threshold Value ANDEnergy > Energy Threshold Value AND Zero Crossing ≤ Second Zero CrossingThreshold Value AND Maximum ≤ First Maximum Threshold Value AND Maximum≤ Second Maximum Threshold Value AND Maximum > Third Maximum ThresholdValue Non-Out-From-Bag Peak-To-Peak ≤ Peak-To-Peak Threshold Value ANDPeak Count ≤ First Peak Count Threshold Value AND Zero Crossing > FirstZero Crossing Threshold Value AND Absolute Mean ≤ First Absolute MeanThreshold Value AND Peak Count > Third Peak Count Threshold Value ANDEnergy > Energy Threshold Value AND Zero Crossing ≤ Second Zero CrossingThreshold Value AND Maximum ≤ First Maximum Threshold Value ANDMaximum > Second Maximum Threshold Value Out-From-Bag Peak-To-Peak ≤Peak-To-Peak Threshold Value AND Peak Count ≤ First Peak Count ThresholdValue AND Zero Crossing > First Zero Crossing Threshold Value ANDAbsolute Mean ≤ First Absolute Mean Threshold Value AND Peak Count >Third Peak Count Threshold Value AND Energy > Energy Threshold Value ANDZero Crossing ≤ Second Zero Crossing Threshold Value AND Maximum > FirstMaximum Threshold Value Non-Out-From-Bag Peak-To-Peak ≤ Peak-To-PeakThreshold Value AND Peak Count ≤ First Peak Count Threshold Value ANDZero Crossing > First Zero Crossing Threshold Value AND Absolute Mean ≤First Absolute Mean Threshold Value AND Peak Count > Third Peak CountThreshold Value AND Energy > Energy Threshold Value AND Zero Crossing >Third Zero Crossing Threshold Value Non-Out-From-Bag Peak-To-Peak ≤Peak-To-Peak Threshold Value AND Peak Count ≤ First Peak Count ThresholdValue AND Zero Crossing > First Zero Crossing Threshold Value ANDAbsolute Mean > First Absolute Mean Threshold Value Out-From-BagCondition Event Peak-To-Peak ≤ Peak-To-Peak Threshold Value AND PeakCount > First Peak Count Threshold Value Out-From-Bag Peak-To-Peak >Peak-To-Peak Threshold Value AND Absolute Mean ≤ Second Absolute MeanThreshold Value AND Peak Count ≤ Fifth Peak Count Threshold ValueNon-Out-From-Bag Peak-To-Peak > Peak-To-Peak Threshold Value ANDAbsolute Mean ≤ Second Absolute Mean Threshold Value AND Peak Count >Fifth Peak Count Threshold Value Out-From-Bag Peak-To-Peak >Peak-To-Peak Threshold Value AND Absolute Mean > Second Absolute MeanThreshold Value Out-From-Bag

In the decision tree above, the first peak count threshold value isgreater than the second peak count threshold value, the first peak countthreshold value is greater than the third peak count threshold value,the third peak count threshold value is less than the fourth peak countthreshold value, the first zero crossing threshold value is greater thanthe second zero crossing threshold value, the first zero crossingthreshold value is less than the third zero crossing threshold value,the first maximum threshold value is greater than the second maximumthreshold value, and the second maximum threshold value is greater thanthe third maximum threshold value.

In block 78, the false out-from-bag detector 50 uses a meta-classifierto filter classifications of the electrostatic charge measurement signalin block 76. The false out-from-bag detector 50 filters classificationsof the electrostatic charge measurement signal to remove or reduce falsepositives.

In one embodiment, the false out-from-bag detector 50 reduces falsedetections of the out-from-bag event by maintaining a first count value.The first count value is a total number of times the false out-from-bagdetector 50 classified the electrostatic charge measurement signal asthe out-from-bag event. When the total number is equal to or greaterthan a first threshold count value, the false out-from-bag detector 50determines that the electrostatic charge measurement signal is theout-from-bag event.

Similarly, in one embodiment, the false out-from-bag detector 50 reducesfalse detections of the non-out-from-bag event by maintaining a secondcount value. The second count value is a total number of times the falseout-from-bag detector 50 classified the electrostatic charge measurementsignal as the non-out-from-bag event. When the total number is equal toor greater than a second threshold count value, the false out-from-bagdetector 50 determines that the electrostatic charge measurement signalis the non-out-from-bag event.

It is noted that block 78 may be removed from the method 66 (i.e., notperformed) to reduce latency of the false out-from-bag detectorclassification block 76.

Subsequent to block 78, the false out-from-bag detector 50 outputs thedetection results to the in-bag detection logic 38 for furtherprocessing as explained above with respect to FIG. 3 .

It is noted that the handheld detector classification in block 72 andthe false out-from-bag detector classification in block 76 are bothperformed using the features extracted in block 70. Stated differently,the same features may be used for handheld detector classification andfalse out-from-bag detector classification. As a result, the sensorcontroller 16 is able to extract a single set of features for handhelddetector classification and false out-from-bag detector classification,and reduce computational costs.

The program or algorithm to perform the in-bag state detection and theout-from-bag event detection discussed above may be implemented inseveral different locations within the device 10. FIGS. 9 to 11illustrate different implementations of the device 10.

FIG. 9 is a block diagram of the device 10 according to an embodimentdisclosed herein. The device 10 includes an operating system layer 80, asystem on chip (SOC) 82, the motion sensor 12, the electrostatic chargesensor 14, and the sensor controller 16.

As discussed above, the operating system layer 80 includes an operatingsystem of the device 10 that, for example, controls and coordinates thehardware components of the device 10 and any peripheral devicescommunicatively coupled to the device 10. The SOC 82 is communicativelycoupled to the operating system layer 80. The SOC 82 is, for example, anintegrated circuit that includes the hardware components of the device10, such as a processing unit, memory, input/output ports, etc. Themotion sensor 12 and the electrostatic charge sensor 14 arecommunicatively coupled to the sensor controller 16. As discussed above,the motion sensor 12 and the electrostatic charge sensor 14 transmitmotion measurements and electrostatic charge measurements, respectively,to the sensor controller 16. The sensor controller 16 is included in theSOC 82. As discussed above, the sensor controller 16 receives motionmeasurements from the motion sensor 12 and electrostatic chargemeasurements from the electrostatic charge sensor 14, and determineswhether the device 10 is in the in-bag state or the out-from-bag eventoccurred based on the motion measurements and electrostatic chargemeasurements.

FIG. 10 is a block diagram of the device 10 according to an embodimentdisclosed herein. Similar to the embodiment shown in FIG. 9 , the device10 includes the operating system layer 80, the motion sensor 12, theelectrostatic charge sensor 14, and the sensor controller 16. However,in contrast to the embodiment shown in FIG. 9 , the device 10 does notinclude the SOC 82. Rather, the sensor controller 16 is communicativelycoupled directly with the operating system layer 80, without the SOC 82being an intervening connection.

FIG. 11 is a block diagram of the device 10 according to an embodimentdisclosed herein. Similar to the embodiment shown in FIG. 10 , thedevice 10 includes the operating system layer 80, the motion sensor 12,and the electrostatic charge sensor 14. However, in contrast to theembodiment shown in FIG. 10 , the device 10 does not include the SOC 82and the sensor controller 16. Instead, the motion sensor 12 and theelectrostatic charge sensor 14 are communicatively coupled to theoperating system layer 80. In this embodiment, the motion sensor 12 andthe electrostatic charge sensor 14, themselves, are capable ofperforming processing operations, and the operations of the sensorcontroller 16 are implemented directly in hardware of the motion sensor12 and the electrostatic charge sensor 14. For example, the motionsensor 12 and the electrostatic charge sensor 14 are included in asingle combination sensor with processing capabilities. The singlecombination sensor performs the functions of the sensor controller 16 asdiscussed above.

The various embodiments shown in FIGS. 9 to 11 have different currentconsumptions. The current consumption of the embodiment shown in FIG. 9is greater than the current consumption of the embodiment shown in FIG.10 , and the current consumption of the embodiment shown in FIG. 10 isgreater than the current consumption of the embodiment shown in FIG. 11. A manufacturer may adjust the implementation of the in-bag andout-from-bag detections disclosed herein to meet various powerrequirements of the device 10.

The various embodiments disclosed herein provide a device that detectswhether the device is in a bag or is being taken out of the bag. Thedevice determines whether the device is in a bag or being taken out ofthe bag based on motion measurements generated by at least one motionsensor and electrostatic charge measurements generated by at least oneelectrostatic charge sensor. The device subsequently adjusts a powerstate of the device based on whether the device is in the bag or beingtaken out of the bag. Using electrostatic charge measurements reducescurrent consumption and memory of in-bag detection and reduces falsedetections of out-from-bag event, compared to current in-bag andout-from-bag detection methods. As a result, the device disclosed hereinis able to detect whether the device is in the bag or is being taken outof the bag with high efficiency, accuracy, and robustness.

The various embodiments described above can be combined to providefurther embodiments. These and other changes can be made to theembodiments in light of the above-detailed description. In general, inthe following claims, the terms used should not be construed to limitthe claims to the specific embodiments disclosed in the specificationand the claims, but should be construed to include all possibleembodiments along with the full scope of equivalents to which suchclaims are entitled. Accordingly, the claims are not limited by thedisclosure.

1. A device, comprising: a motion sensor configured to generate a motionmeasurement signal of the device; an electrostatic charge sensorconfigured to generate an electrostatic charge measurement signal of thedevice; and a controller configured to: determine an activity state ofthe device based on the motion measurement signal; determine a flatstate of the device based on the motion measurement signal; determine ahandheld state of the device based on the electrostatic chargemeasurement signal; determine an in-bag state of the device based on theactivity state, the flat state, and the handheld state, the in-bag stateindicating the device is in a bag; determine an out-from-bag event ofthe device based on the motion measurement signal and the electrostaticcharge measurement signal, the out-from-bag event indicating the deviceis being taken out of the bag; and adjust a power state of the devicebased on the in-bag state or the out-from-bag event.
 2. The device ofclaim 1 wherein the activity state indicates whether the device isstationary or in transport, the flat state indicates the device ispositioned on a flat surface, and the handheld state indicates thedevice is held in a user’s hand.
 3. The device of claim 1 wherein thecontroller is configured to: determine at least one characteristic ofthe electrostatic charge measurement signal; and determine the handheldstate of the device based on the at least one characteristic.
 4. Thedevice of claim 3 wherein the at least one characteristic includes atleast one of an energy calculation, a variance calculation, a zerocrossing calculation, a peak-to-peak calculation, a peak countcalculation, an absolute mean calculation, a maximum calculation, or aminimum calculation.
 5. The device of claim 1 wherein the electrostaticcharge sensor includes at least one electrode.
 6. The device of claim 5,further comprising: a first surface; and a second surface, theelectrostatic charge sensor including a first electrode on the firstsurface and a second electrode on the second surface.
 7. The device ofclaim 1 wherein the controller adjusts the power state of the device byinstructing an operating system of the device to change the power stateof the device.
 8. The device of claim 1 wherein the handheld state isdetermined using one of a decision tree, a neural network, or a supportvector machine.
 9. The device of claim 1 wherein the controller isconfigured to determine an orientation change of the device based on themotion measurement signal, and the out-from-bag event is determinedbased on the orientation change.
 10. The device of claim 9 wherein thecontroller is configured to determine a false detection of theorientation change based on the electrostatic charge measurement signal.11. The device of claim 10 wherein the controller is configured to:determine at least one characteristic of the electrostatic chargemeasurement signal; and determine the false detection of the orientationchange based on the at least one characteristic.
 12. The device of claim11 wherein the at least one characteristic includes at least one of anenergy calculation, a variance calculation, a zero crossing calculation,a peak-to-peak calculation, a peak count calculation, an absolute meancalculation, a maximum calculation, or a minimum calculation.
 13. Adevice, comprising: a motion sensor configured to generate a motionmeasurement; an electrostatic charge sensor configured to generate anelectrostatic charge measurement, the electrostatic charge sensorincluding at least one electrode at a surface of the device; and acontroller configured to: determine an activity state of the devicebased on the motion measurement; determine a flat state of the devicebased on the motion measurement; determine a handheld state of thedevice based on the electrostatic charge measurement; and output anin-bag state of the device based on the activity state, the flat state,and the handheld state, the in-bag state indicating the device is in abag.
 14. The device of claim 13 wherein the controller is configured todetermine an out-from-bag event of the device based on the motionmeasurement and the electrostatic charge measurement, the out-from-bagevent indicating the device is being taken out of the bag.
 15. Thedevice of claim 13 wherein the device includes a plurality of surfaces,the electrostatic charge sensor includes a plurality of electrodes, andeach of the plurality of electrodes is at a respective surface of theplurality of surfaces.
 16. The device of claim 13 wherein the controlleris configured to adjust a power state of the device based on the in-bagstate, and the power state includes at least one of a working state, alow power state, a sleep state, a hibernate state, a soft off state, ora mechanical off state.
 17. The device of claim 13 wherein the activitystate indicates whether the device is stationary or in transport, theflat state indicates the device is positioned on a flat surface, and thehandheld state indicates the device is held in a user’s hand.
 18. Adevice, comprising: a motion sensor configured to generate a motionmeasurement signal of the device; an electrostatic charge sensorconfigured to generate an electrostatic charge measurement signal of thedevice; and a controller configured to: determine an orientation changeof the device based on the motion measurement signal; determine anout-from-bag event of the device in response to the orientation changebeing determined, the out-from-bag event indicating the device is beingtaken out of the bag; determine an electrostatic discharge based on theelectrostatic charge measurement signal; validate the out-from-bag eventin response to the electrostatic discharge being determined; and outputthe out-from-bag event in response to the out-from-bag event beingvalidated.
 19. The device of claim 18 wherein the controller isconfigured to: determine at least one characteristic of theelectrostatic charge measurement signal; and determine a false detectionof the orientation change based on the at least one characteristic. 20.The device of claim 19 wherein the at least one characteristic includesat least one of an energy calculation, a variance calculation, a zerocrossing calculation, a peak-to-peak calculation, a peak countcalculation, an absolute mean calculation, a maximum calculation, or aminimum calculation.